package com.itheima;

import java.util.Scanner;

public class TestDemo02 {
    public static void main(String[] args) {
        String userName = "goudan";
        String passWord = "000000";
        Scanner sc = new Scanner(System.in);
        for (int i = 1; i <= 3; i++) {
            System.out.println("请输入账户名：");
            String zhanghuming = sc.nextLine();
            System.out.println("请输入密码：");
            String mima = sc.nextLine();
            if (userName.equals(zhanghuming) && passWord.equals(mima)) {
                System.out.println("登录成功");
                break;
            } else {
                if (i==3) {
                    System.out.println("请明天再试！！！");
                } else {
                    System.out.println("账户名或密码错误,你还可以输入" + (3 - i) + "次");
                }
            }
        }
    }
}
